<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/6/25
 * Time: 20:09
 */

namespace app\api\controller;


use app\common\controller\BaseApi;
use \app\common\model\GameAccount;

class Gameaccountapi extends BaseApi
{
    //根据游戏id获取待卖号信息 审核状态条件未添加
    public function getTransactionByGameId()
    {
        return $this->commonData(1,GameAccount::instance()->where(['ga.game_id'=>I('id',1,'intval'),'ga.wait_transaction'=>1])->alias('ga')
            ->join('game_info g','g.id=ga.game_id')->join('open_service_manage osm','ga.service_id = osm.id')
            ->field('ga.*,g.id,g.game_name,osm.id,osm.service_name')->select());
    }

    //获取全部待卖账号 审核状态条件未添加
    public function  getTransaction()
    {
        return $this->commonData(1,GameAccount::instance()->where(['ga.wait_transaction'=>1])->alias('ga')
            ->join('game_info g','g.id=ga.game_id')->join('open_service_manage osm','ga.service_id = osm.id')
            ->field('ga.*,g.id,g.game_name,osm.id,osm.service_name')->select());
    }

}